﻿using System.Xml.Serialization;
using Harvest.Api.Types;

namespace Harvest.Api.Model.Internal
{

  //<task>
  //  <billable-by-default type="boolean">false</billable-by-default>
  //  <cache-version type="integer">1200911782</cache-version>
  //  <created-at type="datetime">2009-04-08T06:23:22Z</created-at>
  //  <deactivated type="boolean">true</deactivated>
  //  <default-hourly-rate type="decimal" nil="true"></default-hourly-rate>
  //  <id type="integer">279056</id>
  //  <is-default type="boolean">true</is-default>
  //  <name>Admin</name>
  //  <updated-at type="datetime">2009-04-09T08:02:52Z</updated-at>
  //</task>

    /// <summary>
    /// 
    /// </summary>
    /// <remarks>
    /// Don't change the XmlElement attributes, otherwise (de)serialization will fail.
    /// </remarks>
    [XmlRoot(ElementName = "task", IsNullable = false)]
    public class TaskItem
    {

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "id", IsNullable = true)]
        public NullableInt Id { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "billable-by-default")]
        public bool BillableByDefault { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "deactivated ")]
        public bool Deactivated { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "default-hourly-rate", IsNullable = true)]
        public NullableDouble DefaultHourlyRate { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "is-default")]
        public bool IsDefault { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "name")]
        public string Name { get; set; }

        // Added because of attribute usage in time tracking api
        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "billable")]
        public bool Billable { get; set; }

    }

}
